class CreatePosts < ActiveRecord::Migration
  def self.up
    create_table :posts do |t|
      t.column :topic_id, :integer
      t.column :user_id, :integer
      t.column :name, :string
      t.column :content, :text
      t.column :created_at, :timestamp
      t.column :updated_at, :timestamp
      t.column :id, :string
    end
    
    add_index :posts, :user_id
    add_index :posts, :topic_id
    
  end

  def self.down
    drop_table :posts
  end
end
